package com.iafme.dto.res;

import cn.zhxu.bs.bean.DbField;
import cn.zhxu.bs.bean.DbIgnore;
import cn.zhxu.bs.bean.SearchBean;
import lombok.Data;

import java.io.Serializable;
import java.time.LocalDateTime;
import java.util.List;

/**
 * @author summer
 * @version 1.0
 * @date 2025/3/26 20:40
 */
@Data
@SearchBean(tables = " iafme_certificate_order o LEFT JOIN iafme_project p ON o.projectId=p.id " +
        "LEFT JOIN iafme.iafme_member im on o.memberId=im.id " +
        "LEFT JOIN iafme.iafme_level il on o.levelId=il.id " +
        "    LEFT JOIN iafme_certificate_order_item item ON item.orderId=o.id " +
        " LEFT JOIN iafme.iafme_certificate ic on  item.certificateId=ic.id " ,groupBy = "o.id",orderBy = "o.examineTime DESC")
public class ExamineResDTO implements Serializable {

    @DbField("o.id")
    private Integer id;

    @DbField("im.igaasId")
    private String igAasId;

    @DbField("im.idCard")
    private String idCard;

    @DbField("GROUP_CONCAT(ic.name)")
    private String certificateName;

    @DbField("p.name")
    private String projectName;

    @DbField("il.name")
    private String levelName;

    @DbField("im.name")
    private String memberName;

    @DbField("o.authorization")
    private Integer authorization;

    @DbField("(CASE WHEN o.authorization=1 THEN '审核中' WHEN o.authorization=2 THEN '审核通过' WHEN o.authorization THEN '审核未通过' END)")
    private String statusName;

    @DbField("o.examineTime")
    private LocalDateTime examineTime;

    @DbField("o.avatarImage")
    private String avatarImage;

    @DbField("o.examTime")
    private LocalDateTime examTime;

    @DbField("o.status")
    private Integer status;


    @DbIgnore
    private List<CertificateImagesResDTO> certificateImages;

}
